package com.jrx.anytxn.reporting.job.reportingFile.step;

import com.jrx.anytxn.param.entity.PrOrganizationTable;
import com.jrx.anytxn.reporting.entity.MrCustomerInfo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.HashMap;
import java.util.Map;

public class CustInfoFileReader extends MyBatisPagingItemReader<MrCustomerInfo> {

    public CustInfoFileReader(SqlSessionFactory sqlSessionFactory, PrOrganizationTable org, Integer pagesize){
        setSaveState(false);
        setPageSize(pagesize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.reporting.mapper.ext.ExtMrCustomerInfoMapper.selectByBusinessDate");
        Map<String, Object> map = new HashMap<>();
        map.put("businessDate",org.getNextProcessingDate());
        setParameterValues(map);
    }
}
